echo install dot net framework
if not exist "%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\System.Core.dll" (
	"%~dp0dotNetFx40_Full_x86_x64.exe" /q /norestart 
)
rem "C:\Program Files\Microsoft SQL Server\100\KeyFile\sql_ssms_keyfile.dll"
if not exist "%ProgramFiles%\Microsoft SQL Server\100\KeyFile\sql_ssms_keyfile.dll" (
echo install sql server 2008 express

if exist "%~dp0SQLEXPR_x86_ENU.exe" (
	"%~dp0SQLEXPR_x86_ENU.exe" /QUIET /INSTANCEID="SQLExpress" /ACTION="Install" /FEATURES=SQLENGINE,RS
) else (
	"%~dp0SQLExpr32_x86_enu.exe" /QUIET /INSTANCEID="SQLExpress" /ACTION="Install" /FEATURES=SQLENGINE,RS
)
)

echo install database instance
call "%~dp0InstallDatabaseInstance.bat"
echo install desktop
call "%~dp0newshotcut.bat"
echo run tool
call "%~dp0Rem.Explorer.exe"

exit /b 0